package cn.itcast.config;

import cn.itcast.interceptor.MyInterceptor;
import cn.itcast.interceptor.TokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author 辉
 * @title: WebConfig
 * @projectName wx_shop
 * @description: TODO
 * @date 2019/6/510:52
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/wxshop/test/**").excludePathPatterns("/wxshop/user/**","/wxshop/user/imageUpload");
        registry.addInterceptor(new TokenInterceptor()).addPathPatterns("/wxshop/message/**","/dhn/message/**").excludePathPatterns("/wxshop/message/login","/wxshop/message/sendOrder","/wxshop/message/getAllHorseman","/wxshop/message/check","/dhn/message/addchildrenClassify","/dhn/message/addMainClassify");
        super.addInterceptors(registry);
    }

}